package com.common.aliyun.oss;

import com.common.aliyun.oss.properties.OssProperties;
import com.common.aliyun.oss.template.OssTemplate;
import lombok.SneakyThrows;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

/**
 * @author zhengzg
 * @create 2023-09-18 9:46
 */
@Configuration
@EnableAutoConfiguration
public class OssAutoProperties {

    @Resource
    private OssProperties ossProperties;

    @SneakyThrows
    @Bean
    public OssTemplate ossTemplate () {
        return new OssTemplate(ossProperties);
    }

}
